package com.zx.mes.hyl.stack;

import org.junit.Test;

/**
 * stack 测试
 * @author huayunlong
 * @date 2018-7-12
 */
public class TestStack {

    @Test
    public void test(){
        ArrayStack<String> stack = new ArrayStack<>(5);
        stack.push("神一般的存在");
        stack.push("test");
        stack.push("xxx");
        stack.push("xxx1");
        stack.push("xxx2");
        stack.push("xxx3");
        stack.push("xx4");
        stack.push("xxx5");

        stack.pop();
        stack.pop();
        stack.pop();
        stack.pop();
        stack.pop();
        stack.pop();
        System.out.println(stack.isEmpty());

        System.out.println(stack.peek());
        System.out.println(stack);
    }
}
